const { Role } = require('../../../model/role.js');
module.exports = async (req, res) => {
    let roles = await Role.find().sort('-createTime');
    let data = roles.map((item, index) => {
        return Object.assign({}, { 'role': item.role, 'status': item.status })
    })
    res.send({ 'code': 0, "data": data });
}